function clone(obj) {
    return JSON.parse(JSON.stringify(obj));
}

var a = {name: 'Петър', age: 21};
var b = clone(a);
console.log(a == b);

var c = a;
console.log(a == c);